<h1>Listing collections</h1>

<table>
  <tr>
    <th>Title</th>
    <th>Books nb</th>
    <th>Type</th>
    <th>Description</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @collections.each do |collection| %>
  <tr>
    <td><%= collection.title %></td>
    <td><%= collection.books_nb %></td>
    <td><%= collection.type %></td>
    <td><%= collection.description %></td>
    <td><%= link_to 'Show', collection %></td>
    <%if @user && @user.admin? %>
	    <td><%= link_to 'Edit', edit_collection_path(collection) %></td>
	    <td><%= link_to 'Destroy', collection, :method => :delete, :data => { :confirm => 'Are you sure?' } %></td>
    <% end %>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Collection', new_collection_path %>
